<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  </head>
  <body>
    <script>
        // 创建axios实例
      const instance = axios.create({
        baseURL: "http://192.168.123.152:8000",
        timeout: 5000,
        headers: { "X-Custom-Header": "foobar" },
      });
    //   登陆
      instance({
        url: "/users/login",
        method: "post",
        data: {
          user_name: "liyi",
          password: "123456",
        },
      }).then((res) => {
        console.log(res.data);
      });
    //   获取验证码
      instance({
        url:'/users/captcha'
      }).then(res=>{
        console.log(res.data);
        
      })
    </script>
  </body>
</html>
